package org.hot100_6.leetcode104;

import org.leetcode.TreeNode;

public class Solution {
    public int maxDepth(TreeNode root) {
        if (root==null){
            return 0;
        }

        int leftDepth = maxDepth(root.left);
        int rightDepth = maxDepth(root.right);

        return Math.max(leftDepth,rightDepth)+1;
    }






}
